#pragma once

#include <map>
#include <time.h>
#include <vector>
#include <set>
#include <algorithm>

#include "../share/log.h"
#include "../share/timer.h"

using namespace std;


struct red_flag_time_node
{
	unsigned int player_id;
	unsigned int label_id;

	bool operator ==(red_flag_time_node & node) const
	{
		return (player_id == node.player_id && label_id == node.label_id);
	}
};


class red_flag_timer : public ::common::CTimer
{
	typedef red_flag_time_node type_data;

	multimap<unsigned int, type_data> time_map;

	bool is_start;
	bool is_stop;
	
	typedef void(*fun)(type_data);

	fun data_operate_fun = NULL;
public:
	red_flag_timer() {};
	~red_flag_timer() {};
public:
	
	bool set_data_fun(fun data_fun);

	void on_unlock_timer();

	unsigned int insert_data(unsigned int data_time, type_data data_value);

	virtual void TimerActive();
};





